<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../scripts/ext-3.3.1/resources/css/ext-all.css"/>
	<link rel="stylesheet" type="text/css" href="../styles/global.css"/>
	<link rel="stylesheet" type="text/css" href="../styles/elements.css"/>
	<link rel="stylesheet" type="text/css" href="../scripts/jquery-ui-1.8.16/jquery-ui-1.8.16.custom.css" />
	<script type="text/javascript" src="../scripts/jquery-ui-1.8.16/jquery-1.6.2.min.js"></script>
	<script type="text/javascript" src="../scripts/jquery-ui-1.8.16/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="../scripts/ext-3.3.1/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="../scripts/ext-3.3.1/ext-all.js"></script>
	<script type="text/javascript" src="../scripts/extjs-plus.js"></script>
	<script type="text/javascript">
	Ext.onReady(function(){
		loadData("<s:property value='rq'/>");
		registerSelectRq();
	});
	function rqchanged(rq){
		if(rq==null || rq=='')return;
		loadData(rq);
		
	}
	function registerSelectRq(){
		$("#rq").datepicker({
			dateFormat:'yy-mm-dd',
			changeYear:true,
			changeMonth:true,
			monthNamesShort:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
			monthNames:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
			dayNames:['周日','周一','周二','周三','周四','周五','周六'],
			dayNamesShort:['日','一','二','三','四','五','六'],
			dayNamesMin:['日','一','二','三','四','五','六']
		});
	}
	function loadData(rq){
		<s:iterator value="list" var="config">
		var cm = [new Ext.grid.RowNumberer()];
		var record = [{name:"index",type:"int"}];
		<s:iterator value="colConfig" var="col" status="st">
			cm.push({header:"<s:property value="col"/>",dataIndex:"col<s:property value="#st.index"/>"});
			record.push({name:"col<s:property value="#st.index"/>",type:"string"});
		</s:iterator>
		var options<s:property value='id'/> = {
				cm: new Ext.grid.ColumnModel(cm),
				record:new Ext.data.Record.create(record),
	            url:"<s:url action='ph_query'/>"+"?id=<s:property value='id'/>&rq="+rq,
	            width:300,
	           	title:"<s:property value="title"/>"
			};
			
			var p = create_gridpanel(options<s:property value='id'/>);
			p.getView().forceFit = true;
			$("#data<s:property value='id'/>").empty();
			p.render("data<s:property value='id'/>");
		</s:iterator> 
	}
	</script>
</head>
<body>
<div style="color:gray;padding:5px">数据日期：<input style="font-size:12px;background-color:#D9E8FB;text-align:center;width:80px;font-weight:bold" readonly id="rq" type="text" value="<s:property value='rq'/>" onchange="rqchanged(this.value)"/></div>
<s:iterator value="list" var="config">
<div id="data<s:property value='id'/>" style="float:left;margin:5px;"></div>
</s:iterator>
<div style="padding-top:20px;clear:both"></div>
</body>
</html>